<template>
	<view class="container">
		<hui-parser :html="content"/>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code:'',
				type:'',
				content:''
			};
		},
		onLoad(options) {
		      if (options.title) {
				// console.log(options)
				uni.setNavigationBarTitle({
					title:options.title
				})
			}
			if (options.code) {
					this.code = options.code
			}
			if (options.type) {
					this.type = options.type
					this.getInfo()
			}
		},
		methods:{
			async getInfo(){
				const [err,res] = await this.$get(this.$api.getItemByCodeAndType,{
					code:this.code,
					type:this.type
				})
				if(res){
					this.content = res.data.value
					console.log(res)
				}
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
